#pragma once

#include <string>
#include <d3dx9.h>


struct IDirect3DDevice9;
struct IDirect3DVertexBuffer9;
struct IDirect3DTexture9;
class CGraphicsController;
class ICameraImpl;

///////////////////////////////////////////////////////////////////////////////

struct CSkyBoxVertex
{
   CSkyBoxVertex(float x, float y, float z, float u, float v)
         : m_pos(x, y, z),
         m_u(u), m_v(v)
   {
   }

   D3DXVECTOR3 m_pos;
   float m_u, m_v;

   static DWORD FVF;
};

///////////////////////////////////////////////////////////////////////////////

class CSkyBox
{
private:
   CGraphicsController& m_graphicsController;

   IDirect3DVertexBuffer9* m_vertices;
   IDirect3DTexture9* m_textures[6];

public:
   CSkyBox(CGraphicsController& graphicsController,
           const std::wstring& topFaceTexFileName,
           const std::wstring& bottomFaceTexFileName,
           const std::wstring& frontFaceTexFileName,
           const std::wstring& backFaceTexFileName,
           const std::wstring& leftFaceTexFileName,
           const std::wstring& rightFaceTexFileName);

   ~CSkyBox(void);

   void render(const ICameraImpl& camera);
};

///////////////////////////////////////////////////////////////////////////////
